import { get, post, del } from "./utils";

export const postMarkdown = async ({ id, title, content }: {id: string, title:string, content: string}) => {
  return post("/markdown", { id, title, content }, {});
};

export const getMarkdownTitles = async () => {
  return get("/markdown_titles", {}, []);
};

export const getMarkdown = async ({ id }) => {
  return get(`/markdown/${id}`, {}, {});
};

export const removeMarkdown = async ({ id }) => {
  return del(`/markdown/${id}`);
};

export const buildChroma = async () => {
  return post("/build_chroma", {});
};

export const ask = async (question: string) => {
  return post("/ask", { question });
};
